package algorithms.search


import redirectSystemIn
import redirectSystemOut
import org.junit.jupiter.api.Test
import java.util.*

class PairsTests {
    @Test
    fun pairsTest() {
        redirectSystemIn(this.javaClass) {
            val scan = Scanner(System.`in`)
            redirectSystemOut { expectedList ->
                while (scan.hasNextLine()) {
                    val nk = scan.nextLine().split(" ")

                    val n = nk[0].trim().toInt()

                    val k = nk[1].trim().toInt()

                    val arr = scan.nextLine().split(" ").map{ it.trim().toInt() }.toTypedArray()

                    val result = pairs(k, arr)

                    println(result)

                    expectedList.add(scan.nextLine().trim())
                }
            }
        }
    }
}